#include "bitlog.h"
using namespace bitlog;

void test()
{
    DEBUG("%s", "测试日志");
    INFO("%s", "测试日志");
    WARN("%s", "测试日志");
    ERROR("%s", "测试日志");
    FATAL("%s", "测试日志");
}

int main()
{
    std::string logger_name = "Async_logger";
    std::unique_ptr<LoggerBuilder> builder(new GlobalLoggerBuilder());
    builder->buildLoggerType(LoggerType::LOGGER_ASYNC);
    builder->buildLoggerName(logger_name);
    builder->buildLoggerLevel(LogLevel::lev::WARN); 
    builder->buildSink<StdoutSink>();
    builder->buildSink<FileSink>("./logfile/test.log");
    builder->buildSink<RollBySizeSink>("./logfile/test.log", 1024 * 1024 * 10);
    builder->buildSink<RollByTimeSink>("./logfile/test.log", 60);

    builder->build();

    test();
    
    return 0;
}